<?php
/*
 * Created on Sep 4, 2009
 *
 * To change the template for this generated file go to
 * Window - Preferences - PHPeclipse - PHP - Code Templates
 */
?>
<?php
class Model_type extends Model {
	var $_tbl_name;

	function Model_type() {
		// Call the Model constructor
		parent :: Model();
		$this->_tbl_name = "tbl_type";
	}
	
	/**
	 *
	 */
	function fetchAll(){
		$query = $this->db->get($this->_tbl_name);
		//echo $this->db->last_query();
		if ($query->num_rows() > 0) {
			return $query->result_array();
		}
		return null;
	}
	/**
	 *
	 *
	 */
	function find($id){
		$this->db->where('id', $id);
		$query = $this->db->get($this->_tbl_name);	

		if ($query->num_rows() > 0) {
			return $query->first_row('array');
		}
		return null;
	}
}
?>